﻿
$(function() {
    JSUtility.url = '../Handler/AjaxHandle.ashx';
    JSUtility.param = { AssemblyName: "OA.Bll.Personnel", ClassName: "OA.Bll.Personnel.EducationPresenter", Method: "Search", Options: {} };
    //   autoResize({ dataGrid: '#FulltimeEducationGrid', callback: InitFulltimeEducationlist, par: JSUtility.param, method: 'Paged' });
    autoResize({ dataGrid: '#Grid', callback: InitFulltimeEducationlist });
    $('#btnSubmit,#btnCancel').linkbutton();

    JSUtility.window_edit_form = $("#FulltimeEducationFrm");
    JSUtility.window_edit = $("#FulltimeEducationWin");
    $("#btnAdd").bind("click", function() {
        JSUtility.param.Options["EducationType"] = "0";
        JSUtility.add();
    });
    $("#btnDel").click(JSUtility.del);
    $("#btnEdit").bind("click", function() {
        JSUtility.param.Options["EducationType"] = "0";
        JSUtility.update();
    });
    $("#btnRefersh").click(function() {
        $('#grid').datagrid('reload');
    });
    $("#btnSubmit").click(JSUtility.save);
    $('#btnCancel').click(JSUtility.close);
});

function InitFulltimeEducationlist(size) {
    JSUtility.param.Options["EducationType"] = "0";
    var p = JSUtility.param;
    JSUtility.grid = $('#Grid').datagrid({
        width: size.width,
        height: size.height,
        pageSize: Math.round(size.height / 25),
        pageList: [Math.round(size.height / 25)],
        striped: true,
        queryParams: { "json": $.toJSON(p) },
        url: JSUtility.url,
        singleselect: true
    });
}